package biz.impl;

import java.util.List;

import biz.DriverStateBiz;
import dao.DriverDao;
import dao.DriverStateDao;
import dao.impl.DriverDaoImpl;
import dao.impl.DriverStateDaoImpl;
import entity.DriverState;

public class DriverStateBizImpl implements DriverStateBiz {
	DriverStateDao driverStateDao = new DriverStateDaoImpl();
	DriverDao driverDao = new DriverDaoImpl();
	@Override
	public List<DriverState> queryAllDriverState() {
		List<DriverState> DriverStateList=driverStateDao.queryAllDriverState();
		for(DriverState driverState:DriverStateList){
			driverState.setDriverList(driverDao.queryDriverByDriStateId(driverState.getDsId()));
		}
		return DriverStateList;
	}

	@Override
	public DriverState queryDriverOfDriverStateByDriStateId(int driverStateId) {
		DriverState driverState=driverStateDao.queryDriverState(driverStateId);
		driverState.setDriverList(driverDao.queryDriverByDriStateId(driverState.getDsId()));
		return driverState;
	}

}
